import {ClickCountInTime} from "../utils/clickCountInTime";

/**
 * 模拟多次点击，移动端就可以实现双击
 * @param count {number} 点击次数触发
 * @param interval {number} 多次点击所处时间范围内
 * @returns
 */
export default function clickCountInTimeDecorator(count: number = 2, interval: number = 200): MethodDecorator {
  return function (target: object, name: string | symbol, descriptor: TypedPropertyDescriptor<any>) {
    descriptor.value = ClickCountInTime(descriptor.value, count, interval)
  }
}


/**
 @clickCountInTimeDecorator(2)
 gpTop(){
      console.log(666)
      this.$refs.vanListRef.$el.scrollTop=0
    },
 */
